class ApiController < ApplicationController
  def info
    begin
      pickup_password = PickupPassword.find_by_password params[:password]
      return render :text => nil unless pickup_password
      pickup = Pickup.find pickup_password.pickup_id, :select => "avid, wname, uname, reason"
      work = Work.find_by_wid  pickup.avid, :select => "wid, cdate, author_name"
      respond_to do |format|
        format.yaml { render :text => [pickup, work].to_yaml, :content_type => 'text/yaml'}
      end
    rescue
      render :text => nil
    end
  end
end
